﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp13
{

    /// <summary>
    /// 父类
    /// </summary>
    public  class Enemy
    {
        //父类字段
        int _degree;
        int _bool;
        string _name;
        //父类属性
        public int Degree { set; get; }
        public int Bool { set; get;}
        public string Name { set; get; }

        //无参构造
        public Enemy() {
            Console.WriteLine("父类无参构造"+Bool+"初始化血量100");
            Console.WriteLine("父类无参构造" + Degree  + "初始化1");
        }
        public Enemy(string n){
            Name = n;
            Console.WriteLine("父类"+Name +"将敌人姓名初始化");
        }
        //普通方法
        public void Yell()
        {
            Console.WriteLine("父类普通方法" + Name + "此路是我开，哪里走！");
        }
        //虚方法
        public virtual void Attack() {
            Console.WriteLine("父类虚方法 我发起了普通攻击");

        }
    }
}
